<?php
  session_cache_limiter('private,must-revalide');
   /**
   * 处理上传页面
   */ 
    include_once("../config.php");
	include($conf["base_path"] ."lib/thumbnail.php");
    $id= $_POST['id'];	
	$cate_id = 0; //分类
	//date_default_timezone_set('Asia/Shanghai');	
	$time=date('Y-m-d H:i:s');

	$text = work_str($_POST["chinese_edit"], 1);			   
	$cont1 = array("<p>","</p>");
	$cont2 = array("","</br>");
	$text = str_replace($cont1, $cont2, $text);	
  
	$img = $_FILES['img']['name'];	
	$imgname = explode('.',$img);	
	$count = count($imgname)-1;
	$imgn = time().'.'.$imgname[$count];
	$imgn_1 = time().'_1.'.$imgname[$count];
	$query = "UPDATE $TBL_DEAL SET text='$text' where type=5";		
    $res = mysql_query($query) or die(mysql_error());	
	if($_FILES['img']['name']!='')
	{
		$query2= "UPDATE $TBL_DEAL SET img='$imgn_1' where type=5";	
		mysql_query($query2);
		$img_file =$conf['fck_upload'] . "adv";
		$file_full = $img_file."/".$imgn;
		$upload_file = $_FILES['img']['tmp_name'];          
		move_uploaded_file($upload_file, $file_full);  
		$oldpic = $img_file =$conf['fck_upload'] . "adv/".$imgn;
		$newpic = $img_file =$conf['fck_upload'] . "adv/".$imgn_1;	
		new resizeimage($oldpic, "120", "200", "0",$newpic);//缩略圖	
	}
	
	MyNotice("店長信息設置成功", 1, "../news.php");
	exit(0);  
  
?>